package com.chaos.gateway.config.interceptor;

import com.chaos.framework.model.constant.Constants;
import feign.RequestInterceptor;
import feign.RequestTemplate;
import lombok.extern.slf4j.Slf4j;
import org.slf4j.MDC;

@Slf4j
public class OpenFeignRequestInterceptor implements RequestInterceptor {


    @Override
    public void apply(RequestTemplate requestTemplate) {

        String traceId = MDC.get(Constants.TRACE_ID);
        requestTemplate.header(Constants.TRACE_ID, traceId);

    }


}